package com.yzm.edu_service.controller;


import com.yzm.edu_service.entity.EduTeacher;
import com.yzm.edu_service.service.EduTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author Yzm
 * @since 2022-04-11
 */
@Api(value = "讲师管理")
@RestController
@RequestMapping("/edu_service/edu-teacher")
public class EduTeacherController {

    @Autowired
    private EduTeacherService teacherService;

    /**
     * @Description: 查询讲师表所有数据 rest风格
     * @Author: Yzm
     * @Time: 2022/4/13 9:34
     * @Param: []
     * @return: java.util.List<com.yzm.edu_service.entity.EduTeacher>
     */
    @ApiOperation("所有讲师列表")
    @GetMapping("FaAll")
    public List<EduTeacher> findAllTeacher() {
        List<EduTeacher> list = teacherService.list(null);
        return list;
    }

    @ApiOperation("根据ID删除讲师")
    @DeleteMapping("{id}")
    public boolean removerTeacher(@ApiParam(name = "id", value = "讲师ID", required = true) @PathVariable String id) {
        teacherService.removeById(id);
        return false;
    }
}
